package puzzle.sudoku.data;

import tomoto.util.MathUtil;

public class NumGroupSet {
	private NumGroupSelector m_selector;
	private NumGroup[] m_numGroups;

	public NumGroupSet(NumGroupSelector selector) {
		int size = MathUtil.sqr(selector.base);
		m_selector = selector;
		m_numGroups = new NumGroup[size];
		for (int i = 0; i < size; i++) {
			m_numGroups[i] = new NumGroup(size, selector.createPoints(i));
		}
	}

	public NumGroup get(int x, int y) {
		return m_numGroups[m_selector.select(x, y)];
	}

}
